import request from '@/utils/request'

// 线索公海列表
export const seaList = (data: any) => {
  return request({
    url: '/scrm-api/console/clue/seas/list',
    method: 'POST',
    data
  })
}
// 线索公海列表-删除
export const deleteData = (data: any) => {
  return request({
    url: '/scrm-api/console/clue/seas/del',
    method: 'POST',
    data
  })
}
// 获取线索属性
export const getClubSetting = (data: any) => {
  return request({
    url: '/scrm-api/console/clue/attr/list',
    method: 'get',
    params: data
  })
}
// 获取线索等级
export const getClubLevel = (data: any) => {
  return request({
    url: '/scrm-api/console/clue/level/list',
    method: 'get',
    params: data
  })
}
// 获取线索来源
export const getClubSource = (data: any) => {
  return request({
    url: '/scrm-api/console/clue/source/list',
    method: 'get',
    params: data
  })
}
//获取放弃原因
export const reasonList = (data?: any) => {
  return request({
    url: '/scrm-api/console/clue/invalid/list',
    method: 'get',
    params: data
  })
}
// 新建公海
export const newSea = (data: any) => {
  return request({
    url: '/scrm-api/console/clue/seas/create',
    method: 'POST',
    data
  })
}
// 公海详情
export const seaDetail = (data: any) => {
  return request({
    url: '/scrm-api/console/clue/seas/detail',
    method: 'POST',
    data
  })
}

// 转化明细列表
export const conversionList = (data: any) => {
  return request({
    url: '/scrm-api/console/clue/seas/conversion-list',
    method: 'POST',
    data
  })
}

// 第三方接入-表格列表
export const threeList = (data: any) => {
  return request({
    url: '/scrm-api/console/clue/third/list',
    method: 'POST',
    data
  })
}
// 第三方接入-新建
export const newThree = (data: any) => {
  return request({
    url: '/scrm-api/console/clue/third/create-or-update',
    method: 'POST',
    data
  })
}
// 第三方接入-切换状态
export const changeStatus = (data: any) => {
  return request({
    url: '/scrm-api/console/clue/third/enable',
    method: 'POST',
    data
  })
}
// 第三方接入-导入明细
export const importDetail = (data: any) => {
  return request({
    url: '/scrm-api/console/clue/third/import-detail',
    method: 'POST',
    data
  })
}
//线索公海-未分配不可显示字段
export const getDisaled = (data?: any) => {
  return request({
    url: '/scrm-api/console/clue/list-unassigned-field',
    method: 'POST',
    data
  })
}
// 线索公海列表-未分配
export const unassigned = (data: any) => {
  return request({
    url: '/scrm-api/console/clue/list-unassigned',
    method: 'POST',
    data
  })
}
// 线索公海列表-已分配
export const assigned = (data: any) => {
  return request({
    url: '/scrm-api/console/clue/list-assigned',
    method: 'POST',
    data
  })
}
// 线索公海列表-已放弃
export const abandonList = (data: any) => {
  return request({
    url: '/scrm-api/console/clue/list-abandoned',
    method: 'POST',
    data
  })
}
// 线索公海列表-已退回
export const backList = (data: any) => {
  return request({
    url: '/scrm-api/console/clue/list-returned',
    method: 'POST',
    data
  })
}
// 设置线索类型配置
export const setSettings = (data: any) => {
  return request({
    url: '/scrm-api/console/clue/put-default-type',
    method: 'POST',
    data
  })
}
// 获取线索类型配置
export const getSettings = (data?: any) => {
  return request({
    url: '/scrm-api/console/clue/get-default-type',
    method: 'POST',
    data
  })
}
//删除&批量删除
export const delData = (data?: any) => {
  return request({
    url: '/scrm-api/console/clue/batch-del',
    method: 'POST',
    data
  })
}
//放弃&批量放弃
export const setAbandon = (data?: any) => {
  return request({
    url: '/scrm-api/console/clue/batch-abandon',
    method: 'POST',
    data
  })
}
//分配&批量分配
export const distribution = (data?: any) => {
  return request({
    url: '/scrm-api/console/clue/batch-distribution',
    method: 'POST',
    data
  })
}
//退回
export const backData = (data?: any) => {
  return request({
    url: '/scrm-api/console/clue/batch-back',
    method: 'POST',
    data
  })
}
//客户转换
export const changeGuest = (data?: any) => {
  return request({
    url: '/scrm-api/console/clue/conversion-pre',
    method: 'POST',
    data
  })
}
//流转记录
export const flowData = (data?: any) => {
  return request({
    url: '/scrm-api/console/clue/flow',
    method: 'POST',
    data
  })
}
// 获取个人线索表单
export const personClub = (data?: any) => {
  return request({
    url: '/scrm-api/console/clue/apply-form',
    method: 'POST',
    data
  })
}

// 保存个人线索表单
export const savepersonClub = (data?: any) => {
  return request({
    url: '/scrm-api/console/clue/put',
    method: 'POST',
    data
  })
}
// 批量添加
export const batchAdd = (data?: any) => {
  return request({
    url: '/scrm-api/console/clue/batch/add',
    method: 'POST',
    data
  })
}
const base_url = 'http://139.224.245.107:80'

// 获取个人线索表单
export const download = (data?: any) => {
  return request({
    url: '/scrm-api/console/clue/batch/download-template',
    method: 'POST',
    data
  })
}
// 客户模板下载
export const download2 = (data: any) => {
  return request({
    method: 'POST',
    url: '/scrm-api/console/customer/opensea/download-template',
    data
  })
}
// 导入记录
export const exportDetail = (data?: any) => {
  return request({
    url: '/scrm-api/console/clue/batch/list',
    method: 'POST',
    data
  })
}
// 导入失败记录
export const failDetail = (data?: any) => {
  return request({
    url: '/scrm-api/console/clue/batch/fail-detail',
    method: 'POST',
    data
  })
}
//线索属性
export const clubSetting = (data?: any) => {
  return request({
    url: '/scrm-api/console/clue/attr/list',
    method: 'get',
    params: data
  })
}
//获取推送地址
export const sendurlData = (data?: any) => {
  return request({
    url: '/scrm-api/console/clue/third/show-address',
    method: 'POST',
    data
  })
}
//客户转化-请求参数
export const getCustomerData = (data?: any) => {
  return request({
    url: '/scrm-api/console/clue/conversion-pre',
    method: 'POST',
    data
  })
}
//客户转化-请求参数
export const getBatchCustomerParams = (data?: any) => {
  return request({
    url: '/scrm-api/console/work/task/batch-conversion',
    method: 'POST',
    data
  })
}
//客户转化-保存
export const getCustomerSave = (data?: any) => {
  return request({
    url: '/scrm-api/console/clue/conversion',
    method: 'POST',
    data
  })
}
//客户公海列表
export const customerList = (data?: any) => {
  return request({
    url: '/scrm-api/console/customer/opensea/drop-down-list',
    method: 'POST',
    data
  })
}
//客户阶段列表
export const customerStatus = (data?: any, flag: boolean = false) => {
  return request({
    url: '/scrm-api/console/customer/stage/list',
    method: 'POST',
    data,
    noNeedLoading: flag
  })
}
//客户来源列表
export const customerFrom = (data?: any, flag: boolean = false) => {
  return request({
    url: '/scrm-api/console/customer/source/list',
    method: 'POST',
    data,
    noNeedLoading: flag
  })
}
export const clientSeas = (data: {}) => {
  return request({
    method: 'POST',
    url: '/scrm-api/console/customer/opensea/list',
    data
  })
}
